# Variables

COMPILER = gmcs
BASE_LIBS = -r:System.dll -r:System.Data.dll -r:System.Xml.dll
OTHER_LIBS = -r:System.Configuration.dll -r:libs/log4net.dll -r:libs/MySql.Data.dll -r:libs/EncodingTools.dll

OUTPUT = bin/builder.exe
#OUTPUT_LIB = bin/DoxytypeObjects.dll

all: builder.exe

# Build application
builder.exe: InstallLibs CopyLibs
	$(COMPILER) -recurse:src/*.cs -t:exe $(BASE_LIBS) $(OTHER_LIBS) -out:$(OUTPUT)

# Build lib
#doxytype:
#	$(COMPILER) -recurse:DoxytypeObjects/*.cs -t:library $(BASE_LIBS) -out:$(OUTPUT_LIB)

# Install libs
InstallLibs:
	gacutil /i libs/MySql.Data.dll
	gacutil /i libs/log4net.dll

# Copy dependencies
CopyLibs:
	cp libs/EncodingTools.dll bin/EncodingTools.dll
	cp builder.exe.config bin/builder.exe.config

# Clean
clean:
	rm -f bin/EncodingTools.dll
	rm -f bin/builder.exe.config
	rm -f $(OUTPUT_LIB)
	rm -f $(OUTPUT)